package com.haiya.srp;

public class SingleResponsibility3 {
    public static void main(String[] args) {
        Vehicle2 vehicle = new Vehicle2();
        vehicle.run("摩托车");
        vehicle.run("汽车");
        vehicle.runAir("飞机");
        vehicle.runWater("轮船");
    }
}

class Vehicle2 {
    public void run(String vehicle) {
        System.out.println(vehicle + "在公路运行......");
    }

    public void runAir(String vehicle) {
        System.out.println(vehicle + "在天空运行......");
    }

    public void runWater(String vehicle) {
        System.out.println(vehicle + "在水里运行......");
    }
}